<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui">
<h:body>
	<p:dialog widgetVar="userAtualizarDialogWidget"
		id="userAtualizarDialogId" height="150" width="500" modal="true"
		closable="true" draggable="false" resizable="false">
		<h:form id="userAtualizarDialogForm" prependId="false">
			<h:panelGrid columns="2">
				<h:outputText value="* #{bundle.nome}" />
				<h:inputText value="#{userMB.usuario.name}" required="true"
					label="#{bundle.name}" />

				<h:outputText value="* #{bundle.sobrenome}" />
				<h:inputText value="#{userMB.usuario.sobrenome}" required="false"
					label="#{bundle.sobrenome}" />
				
				<h:outputText value="* #{bundle.perfilUser}" />  
		         <p:selectOneMenu value="#{userMB.usuario.role}" required="true">  
		            <f:selectItem itemLabel="#{bundle.selecione}" itemValue="" />  
		            <f:selectItem itemLabel="#{bundle.admin}" itemValue="ADMIN" />  
		            <f:selectItem itemLabel="#{bundle.user}" itemValue="USER" />  
		        </p:selectOneMenu> 

				<p:commandButton value="#{bundle.update}" icon="ui-icon-plus"
					action="#{userMB.atualizarUser()}"
					update=":messageGrowl :usersForm:usersTable"
					oncomplete="closeDialogIfSucess(xhr, status, args, userAtualizarDialogWidget, 'userAtualizarDialogId')" />
				<p:commandButton value="#{bundle.cancel}" icon="ui-icon-cancel"
					actionListener="#{userMB.resetUser()}"
					onclick="userAtualizarDialogWidget.hide();" type="button" />
			</h:panelGrid>
		</h:form>
	</p:dialog>
</h:body>
</html>